#pragma once

#include <iostream>
#include "Base/ThreadTool.h"
#include <stdio.h>

#define  CACHE_SIZE (8192)

class LoggerFile
{
public:
	LoggerFile();
	~LoggerFile();

public:
	void setFileName(std::string fileName);
	void write(const char *content);
	int open();
	void flush();
	void close();

private:
	FILE *mFile;
	std::string mFileName;
	self_mutex_t mFlushLock;
	char mCache[CACHE_SIZE];
};


